/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.lihle.designconceptsprinciples.question3.openorcloseprinciple.obeys.model.impl;

import com.lihle.designconceptsprinciples.question3.openorcloseprinciple.obeys.model.CalcTopInterface;
import com.lihle.designconceptsprinciples.question3.openorcloseprinciple.obeys.model.CalcInterface;
import com.lihle.designconceptsprinciples.question3.openorcloseprinciple.obeys.model.NewCalcInterface;

/**
 *
 * @author user
 */
public class CalcTopImpl implements CalcTopInterface {

    private int no1,no2;
    @Override
    public CalcInterface bckuplstCalc() {
       return new NeCalcImpl(no1,no2);
    }

    @Override
    public void replyLstCalculation(NewCalcInterface cal) {
      this.no1 = ((NewCalcInterface)cal).getNum1();
      this.no2 = ((NewCalcInterface)cal).getNum2();
    }

    @Override
    public int getCalcResults() {
      return no1 + no2;
    }

    @Override
    public void setNumber1(int no1) {
        this.no1 = no1;
    }

    @Override
    public void setNumber2(int no2) {
        this.no2 = no2;
    }
    
}
